<!-- <template>
  <div class="test"> -->
    <!-- 顶部导航栏 -->
    <!-- <div class="content_popup">
      <van-nav-bar v-model="show" position="top" :style="{ height: '10%' }">
        <div class="zhihudailyOIABanner">
          <div class="zhihudaily_logo">
            <img
              src="https://static.zhihu.com/heifetz/assets/zhihuDaily.3b5756bb.png"
              alt="logo"
              width="40px"
              height="40px"
            />
          </div>
          <div class="zhihudaily_text">
            <div class="zhihudaily_title">知乎日报</div>
            <div class="zhihudaily_desc">每日提供高质量新闻资讯</div>
          </div>
          <div class="zhihudaily_botton">
            <van-button round type="info">打开&nbsp;App</van-button>
          </div>
        </div>
      </van-nav-bar>
    </div> -->
    <!-- <van-nav-bar class="nav_top"
     title="知乎日报" left-text="" right-text=""/> -->
    <!-- <div :class="type" @click="dackModell">
      {{ type == "theme-dark" ? "夜间模式" : "日间模式" }}
    </div>
  </div> -->
<!-- </template> -->
<!-- <script>
import { Toast } from "vant";
export default {
  data() {
    return {
      // show: true,
      modell: "",
      flag: true,
      type: "theme-dark",
    };
  },
  created() {
    this.axios
      .get("https://apis.netstart.cn/zhihudaily/story/9741200/short-comments")
      .then((res) => {
        console.log("testa", res);
        console.log(111);
        // this.longdata = res
        // this.shortdata =  res.request;
      });
  },
  methods: {
    dackModell() {
      if (localStorage.getItem("modell")) {
        localStorage.removeItem("modell");
        this.flag = false;
      } else {
        localStorage.setItem("modell", "dark");
        this.flag = true;
      }
      this.$router.go(0);
    },
    showPopup() {
      this.show = true;
    },
    onClickLeft() {
      Toast("返回");
    },
    onClickRight() {
      Toast("按钮");
    },
  },
};
</script> -->
<template>
  <div :class="modell">
    <van-nav-bar left-arrow @click-left="onClickLeft" />
    <div class="My-content">
      <div class="user-info">
        <img
          class="user-avatar"
          src="https://pic2.zhimg.com/84aa03ad32d328354dc96485a1637f67_l.jpg?source=8673f162"
          alt
        />

        <div class="user-name">喜羊羊</div>
      </div>

      <div>
        <van-cell @click="goCollection" title="收藏" is-link />
        <van-cell title="设置" is-link />
      </div>

      <div :class="type" @click="dackModell">
        {{ type == "theme-dark" ? "夜间" : "日间" }}
      </div>
      <!-- <van-switch v-model="checked" :class="type" @click="dackModell">{{
        type == "theme-dark" ? "夜间" : "日间"
      }}</van-switch> -->
      <div class="signout" @click="signout">0</div>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      modell: "",
      flag: true,
      type: "theme-dark",
      checked: false,
    };
  },
  methods: {
    onClickLeft() {
      this.$router.push({
        name: "home",
      });
    },
    dackModell() {
      if (localStorage.getItem("modell")) {
        localStorage.removeItem("modell");
        this.flag = false;
      } else {
        localStorage.setItem("modell", "dark");
        this.flag = true;
      }
      this.$router.go(0);
    },
    signout() {
      localStorage.removeItem("isLogin");
      this.$router.go(-1);
    },
    goCollection() {
      this.$router.push({
        name: "home",
      });
    },
  },
  created() {
    if (localStorage.getItem("modell")) {
      this.type = "theme-sun";
    }
    this.modell = localStorage.getItem("modell");
  },
};
</script>
<style lang="less" scoped>
.content_popup {
  .zhihudailyOIABanner {
    display: flex;
    justify-content: space-between;
  }
}
.nav_top {
  background-color: #c4c4c4;
  height: 5rem;
  .zhihudaily_logo {
    margin-top: -0.8rem;
    margin-left: 0.8rem;
  }
  .zhihudaily_text {
    margin-top: 0.8rem;
    margin-left: -1.5rem;
    .zhihudaily_title {
      text-align: left;
      font-weight: bold;
    }
    .zhihudaily_desc {
      color: #c4c4c4;
    }
  }
  .zhihudaily_botton {
    margin-top: 0.8rem;
    margin-right: 0.8rem;
  }
}
/deep/.van-nav-bar .van-icon {
  color: #000;
}
/deep/.van-nav-bar__arrow {
  font-size: 25px;
}
.My-content {
  .user-info {
    margin-top: 20px;
    text-align: center;
    .user-avatar {
      border-radius: 50%;
      overflow: hidden;
      width: 80px;
      height: 80px;
    }
    .user-name {
      margin-top: 10px;
      font-size: 18px;
      color: #000;
      margin-bottom: 30px;
    }
  }
}
.dark {
  height: 100%;
  // background-color: #333333;
  color: rgb(241, 232, 232);
  background: #000;
  /deep/.van-nav-bar__content {
    background: #000;
  }

  /deep/.van-nav-bar .van-icon {
    color: rgb(98, 97, 97) !important;
  }
  /deep/.van-nav-bar__arrow {
    font-size: 25px;
  }

  .My-content {
    .user-name {
      font-size: 18px;
      color: rgb(98, 97, 97);
    }
  }
  .signout {
    position: absolute;
    bottom: 50px;
    right: 70px;
    width: 50px;
    height: 50px;
    // background: url("../assets/jieshu.png") no-repeat center;
    background-size: 70%;
    line-height: 120px;
  }
  .van-cell {
    color: rgb(221, 216, 216);
    background: #000;
  }
}
.theme-dark {
  position: absolute;
  bottom: 50px;
  left: 70px;
  width: 50px;
  height: 50px;
  // background: url("../assets/yueduye-yejianmoshi.png") no-repeat center;
  background-size: 70%;
  line-height: 120px;
}
.theme-sun {
  position: absolute;
  bottom: 50px;
  left: 70px;
  width: 50px;
  height: 50px;
  // background: url("../assets/rijianmoshixhdpi.png") no-repeat center;
  background-size: 70%;
  line-height: 120px;
}
.signout {
  position: absolute;
  bottom: 50px;
  right: 70px;
  width: 50px;
  height: 50px;
  // background: url("../assets/jieshu_s.png") no-repeat center;
  background-size: 70%;
  line-height: 120px;
}
</style>